
import './../style/login.scss'

import $, { post } from 'jquery'
import Swal from 'sweetalert2'

$('input[type="submit"]').click(() => {

    mypost()

})

$('#pwd').keydown(() => {
    if (event.keyCode == 13) {
        mypost()
    }
})

$("#pwd").bind("input propertychange",function(){
    $('.tips').text('')
});

function mypost() {
    let pwd = $('input[type="password"]').val()
    $.ajax({
        type: "GET",
        Headers: {
            "Access-Control-Allow-Origin": "*"
        },
        url: "http://lawyeracloud.seo.com.cn/Api/ApiUn/GetPwd",
        data: {
            pwd: window.btoa(pwd)
        },
        success: function (result) {

            if (result.success == true) {
                location.href = 'managerPage.html'
            } else {
                $('.tips').text('密码错误')
            }
            
            
        },
        error: function (e) {
            $('.tips').text('未输入密码')
           
        }
    });
}